package model.entity.product;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@SuppressWarnings("serial")
@Embeddable
public class ProductDetailsId implements Serializable{

	private int colorId;
	private int sizeId;
	private int productId;

	public ProductDetailsId() {
	}

	public ProductDetailsId(int colorId, int sizeId, int productId) {
		this.colorId = colorId;
		this.sizeId = sizeId;
		this.productId = productId;
	}

	@Column(name = "ColorID", nullable = false)
	public int getColorId() {
		return this.colorId;
	}

	public void setColorId(int colorId) {
		this.colorId = colorId;
	}

	@Column(name = "SizeID", nullable = false)
	public int getSizeId() {
		return this.sizeId;
	}

	public void setSizeId(int sizeId) {
		this.sizeId = sizeId;
	}

	@Column(name = "ProductID", nullable = false)
	public int getProductId() {
		return this.productId;
	}

	public void setProductId(int productId) {
		this.productId = productId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ProductDetailsId))
			return false;
		ProductDetailsId castOther = (ProductDetailsId) other;

		return (this.getColorId() == castOther.getColorId())
				&& (this.getSizeId() == castOther.getSizeId())
				&& (this.getProductId() == castOther.getProductId());
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result + this.getColorId();
		result = 37 * result + this.getSizeId();
		result = 37 * result + this.getProductId();
		return result;
	}

}
